feat(gcc): add gcc/g++/clang compiler output filter#770
feat(gcc): add gcc/g++/clang compiler output filter#770cardillo wants to merge 2 commits intortk-ai:developfrom
Conversation
Adds `rtk gcc` command that groups diagnostics by file, strips verbose caret/source-snippet context lines, and shows a compact BUILD FAILED summary or warnings-only view. - 60-80% token savings on typical compiler output - Handles gcc, g++, clang, clang++ (via --compiler flag) - Strips "In file included from", caret (^), pipe (|) context lines - Groups errors by file, sorted by error count descending - Preserves make error lines for CI/CD exit-code context - 13 unit tests covering all paths, including token savings assertions - Registered in discover/rules.rs for automatic hook rewriting https://claude.ai/code/session_01WfWYojKvkiHdDDHQbYcAyz Signed-off-by: Claude <noreply@anthropic.com> Signed-off-by: Bryan Cardillo <bryan.cardillo@gmail.com>
📊 Automated PR Analysis
SummaryAdds a new Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
|
pszymkowiak
left a comment
There was a problem hiding this comment.
Thanks for the contribution @cardillo — the Rust module approach is the right call here. gcc/clang write diagnostics to stderr, which our TOML filter engine doesn't capture (it only filters stdout). Your module captures both and the grouping-by-file logic is solid.
I tested locally but couldn't get it to work — the issue is that src/filters/gcc.toml already exists and the TOML engine intercepts gcc commands before Clap routes to your gcc_cmd::run(). So your module never gets called.
Could you:
- Delete
src/filters/gcc.tomlfrom your branch — this lets Clap routertk gccto your Rust module instead - Enable "Allow edits from maintainers" on this PR so we can help iterate faster
- Update the filter count in
src/toml_filter.rstests (it will decrease by 1)
Once the TOML conflict is resolved we can re-test savings properly. Looking forward to it!
Signed-off-by: Bryan Cardillo <bryan.cardillo@gmail.com>
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
Adds
rtk gcccommand that groups diagnostics by file, strips verbose caret/source-snippet context lines, and shows a compact BUILD FAILED summary or warnings-only view.https://claude.ai/code/session_01WfWYojKvkiHdDDHQbYcAyz
Summary
Test plan
Running locally and automated test suite.
cargo fmt --all && cargo clippy --all-targets && cargo testrtk <command>output inspected